﻿#If WINDOWS_PHONE Then

Namespace Global.System.Collections.Concurrent

    Public Class ConcurrentDictionary(Of TKey, TValue)
        Inherits Dictionary(Of TKey, TValue)

        Private m_instanceLock As New Object()

        Public Function TryAdd(ByVal key As TKey, ByVal value As TValue) As Boolean
            Try
                SyncLock Me.m_instanceLock
                    MyBase.Add(key, value)
                    Return True
                End SyncLock
            Catch ex As Exception
                Return False
            End Try
        End Function

    End Class

End Namespace

#End If